The present invention relates to a method for encoding and decoding data, and more particularly, to a method and related apparatus of encoding and decoding fixed bit length data string to generate fixed bit length data string.
Data in the form of 1's and 0's is often referred to as a data string. This data string must be modulated and demodulated as part of the process for storing the data on optical disc. Block encoding is a popular technique utilized for the modulation and demodulation task. Block encoding utilizes a data string that is blocked into units with each unit containing some number of bits of data. These blocks of data are typically referred to as data words. Data words that have been encoded are then referred to as code words.
Variable length encoding, as the name implies, utilizes some portion of the data string to form a block. The process for block encoding of data strings is well known in the art. For instance, the industry's conventional coding method and apparatus employed with the Blu-Ray disc format is known as 17PP. The 17PP-coding scheme generates code words that must follow certain rules, such that the number of consecutive zeros between two ones is not less than 1 and not greater than 7, and the code sequence “10” can be repeated at most 6 times.
Please refer to FIG. 1 and FIG. 2. FIG. 1 is a conversion table for encoding according to the related art. FIG. 2 is an inverse conversion table for decoding according to the related art. The conventional conversion table for encoding contains codes for basic encoding codes, substitution codes, and termination codes. Basic codes are those codes that simply encode a data string into a code string, for example, referring to the table shown in FIG. 1, a related art encoding using 17PP-coding scheme for the data string “0011” encodes to code string “010 100”. Substitution codes and termination codes are also required to successfully complete the conversation from raw data to encoded data. In order to get back (i.e., restore) the original raw data, a decoding process is required. That is, the decoding process is used to convert encoded data into original raw data by referring to the table shown in FIG. 2. The coding scheme has been detailed in U.S. Pat. No. 6,496,541 and U.S. patent application publication No. 2003/0184456. For brevity, a detailed description related to the 17PP-coding scheme is omitted here.
As shown in FIG. 1 and FIG. 2, the fetched data is of variable length, and the code words generated are of variable length. In other words, the conventional encoding/decoding conversion tables for the 17PP-coding scheme are used for processing data words and code words, but in the related art, these are all of variable length. Therefore, the conventional variable length encoding/decoding method is inefficient to implement for several reasons, including: utilizing variable length data with which to generate variable length code words requires complex conversion tables and complex substitution rules. These complexities are more difficult to implement and require greater processing resources.